<%-- 
    Document   : user
    Created on : 2019-9-4, 10:05:11
    Author     : danny
--%>

<%@page import="edu.fjs.liyq.dao.impl.UserDaoImpl"%>
<%@page import="edu.fjs.liyq.dao.UserDao"%>
<%@page import="edu.fjs.liyq.entity.User"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%--
    /*
        权限控制代码
    */
    String loginUser = (String) session.getAttribute("LOGIN_USER");
    if (loginUser == null) {
        request.setAttribute("error", "您还未登录！");
        request.getRequestDispatcher("../login.jsp").forward(request, response);
    }
--%>
<%
    UserDao dao = new UserDaoImpl();
    List<User> ul = dao.getAll();
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <table>
            <tr>
                <th>账号</th>
                <th>真实姓名</th>
                <th>性别</th>
            </tr>
        <%
        for (User u : ul) {
        %>
            <tr>
                <td><%=u.getAccount() %></td>
                <td><%=u.getName() %></td>
                <td><%=u.getSex() %></td>
            </tr>
        <%
        }
        %>
        </table>
    </body>
</html>
